\rcube_smtp

Class to provide SMTP functionality using PEAR Net_SMTP

Summary

Methods
Properties
Constants
connect()
send_mail()
reset()
disconnect()
debug_handler()
get_error()
get_response()
No public properties found
SMTP_MIME_CRLF
DEBUG_LINE_LENGTH
No protected methods found
No protected properties found
N/A
_prepare_headers()
_parse_rfc822()
_process_xclient()
$conn
$response
$error
$anonymize_log
N/A

Constants

SMTP_MIME_CRLF

SMTP_MIME_CRLF = "\r\n"

DEBUG_LINE_LENGTH

DEBUG_LINE_LENGTH = 4098

Properties

$conn

$conn

$response

$response

$error

$error

$anonymize_log

$anonymize_log

Methods

connect()

connect(string  $host = null, string  $port = null, string  $user = null, string  $pass = null) : bool

SMTP Connection and authentication

Parameters

string $host

Server host

string $port

Server port

string $user

User name

string $pass

Password

Returns

bool —

True on success, or False on error

send_mail()

send_mail(mixed  $from, mixed  $recipients, mixed  $headers, mixed  $body, mixed  $opts = []) : bool

Function for sending mail

Parameters

mixed $from
mixed $recipients
mixed $headers
mixed $body
mixed $opts

Returns

bool —

True on success, or False on error

reset()

reset() : mixed

Reset the global SMTP connection

Returns

mixed —

disconnect()

disconnect() : mixed

Disconnect the global SMTP connection

Returns

mixed —

debug_handler()

debug_handler(mixed  $smtp, mixed  $message) : mixed

This is our own debug handler for the SMTP connection

Parameters

mixed $smtp
mixed $message

Returns

mixed —

get_error()

get_error() : mixed

Get error message

Returns

mixed —

get_response()

get_response() : mixed

Get server response messages array

Returns

mixed —

_prepare_headers()

_prepare_headers(array  $headers) : mixed

Take an array of mail headers and return a string containing text usable in sending a message.

Parameters

array $headers

The array of headers to prepare, in an associative array, where the array key is the header name (ie, 'Subject'), and the array value is the header value (ie, 'test'). The header produced from those values would be 'Subject: test'.

Returns

mixed —

Returns false if it encounters a bad address, otherwise returns an array containing two elements: Any From: address found in the headers, and the plain text version of the headers.

_parse_rfc822()

_parse_rfc822(mixed  $recipients) : array

Take a set of recipients and parse them, returning an array of bare addresses (forward paths) that can be passed to sendmail or an smtp server with the rcpt to: command.

Parameters

mixed $recipients

Returns

array —

An array of forward paths (bare addresses).

_process_xclient()

_process_xclient() : mixed

Send XCLIENT command if configured and supported

Returns

mixed —